/**检测天数 */
function counter1(days) {
    new Vue({
        el: '#counter1',
        data() {
            return {
                config: {
                    number: [days],
                    content: '{nt}天'
                }
            }
        }
    });
}

/**黑广播数 */
function counter2(num) {
    new Vue({
        el: '#counter2',
        data() {
            return {
                config: {
                    number: [num],
                    content: '{nt}条'
                }
            }
        }
    });
}

/**设备总量 */
function counter3(num) {
    new Vue({
        el: '#counter3',
        data() {
            return {
                config: {
                    number: [num],
                    content: '{nt}台'
                }
            }
        }
    })
}

/**在线设备 */
function counter4(num) {
    new Vue({
        el: '#counter4',
        data() {
            return {
                config: {
                    number: [num],
                    content: '{nt}台'
                }
            }
        }
    })
}

/**axios 检测天数　黑广播数*/
axios
    .get('/d/bigscreen/counter')
    .then(function (response) {
        counter1(response.data.date_diff);
        counter2(response.data.blackbrocast);
    })
    .catch(function (error) {
        console.log(error)
    });
/**axios 设备总量*/
axios
    .get('/d/bigscreen/counter')
    .then(function (response) {
        let data = response.data.MobileNum;
        counter3(data);
    })
    .catch(function (error) {
        console.log(error)
    });
/**axios 在线设备*/
axios
    .get('/d/isworking')
    .then(function (response) {
        let working_list = response.data.working_list;
        let num = Object.keys(working_list).length;
        counter4(num);
    })
    .catch(function (error) {
        console.log(error)
    });
